#include"String.h"

void string_test1()
{
	wjz::string s1("Hello World");
	cout << s1.c_str() << endl;
	for (int i = 0; i < s1.size(); i++)
	{
		cout << s1[i] << ' ';
	}
	cout << endl;

	wjz::string s2("Hello Wjz");
	//wjz::string::const_iterator cit = s2.begin();
	auto cit = s2.begin();
	while (cit != s2.end())
	{
		cout << *cit << ' ';
		cit++;
	}
	cout << endl;
}


void string_test2()
{
	wjz::string s1("Hello");
	s1.push_back(' ');
	cout << s1.c_str() << endl;
	s1.append("World");
	cout << s1.c_str() << endl;

	s1 += ' ';
	s1 += "ssssssssss";
	cout << s1.c_str() << endl;

}

void string_test3()
{
	wjz::string s1("Hello World");
	cout << s1.c_str() << endl;
	s1.resize(5);
	cout << s1.c_str() << endl;

	wjz::string s2("Hello World");
	s2.resize(20, 'x');
	cout << s2.c_str() << endl;

}
int main()
{
	string_test3();
	return 0;
}